package hlhj.fhp.supreme.utils

import android.graphics.Bitmap
import android.opengl.ETC1.getHeight
import android.opengl.ETC1.getWidth



/**
 * Created by Never Fear   on 2018\7\16 0016.
Never More....
 */
object BitmapCut {
    /**
     * 裁剪图片
     */
    fun cutBitmap(bm: Bitmap?): Bitmap? {
        var bitmap: Bitmap? = null
        if (bm != null) {
            if (bm.width/bm.height>1){
                bitmap= Bitmap.createBitmap(bm,0,0,600,300)
            }else{
                bitmap= Bitmap.createBitmap(bm,0,0,300,600)
            }
//            bitmap = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight() / 2) //对图片的高度的一半进行裁剪
        }
        return bitmap
    }
}